package com.ququ.syb.entrance.fegin;

import com.ququ.common.result.Result;
import com.ququ.common.result.ResultJson;
import com.ququ.syb.common.pojo.PayOrder;
import com.ququ.syb.common.pojo.PayResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "payment-business")
public interface PaymentBusinessFegin {

    @RequestMapping(value = "/payorder/callback")
    ResultJson paymentCallback(@RequestParam(value = "tradenum") String tradenum,
                               @RequestParam(value = "status") int status,
                               @RequestParam(value = "failreason") String failreason);

    @RequestMapping(value = "/payorder/create")
    Result<PayOrder> createPayOrder(@RequestParam(value = "orderno") String orderno,
                                    @RequestParam(value = "amount") Long amount,
                                    @RequestParam(value = "ordertype") Integer ordertype,
                                    @RequestParam(value = "title") String title,
                                    @RequestParam(value = "desc") String desc,
                                    @RequestParam(value = "returnurl") String returnurl,
                                    @RequestParam(value = "callbackurl") String callbackurl,
                                    @RequestParam(value = "withdrawcallbackurl") String withdrawcallbackurl,
                                    @RequestParam(value = "payaccountid") String payaccountid,
                                    @RequestParam(value = "payeeaccountid") String payeeaccountid,
                                    @RequestParam(value = "paycommission") Long paycommission,
                                    @RequestParam(value = "payeecommission") Long payeecommission,
                                    @RequestParam(value = "appcode") String appcode,
                                    @RequestParam(value = "paychannelid") String paychannelid,
                                    @RequestParam(value = "assureday") Integer assureday,
                                    @RequestParam(value = "timeout") Integer timeout,
                                    @RequestParam(value = "divideinfo") String divideinfo);


    @RequestMapping(value = "/payorder/pay")
    Result<PayResult> paymentOrPaySms(@RequestParam(value = "tradenum") String tradenum,
                                      @RequestParam(value = "name") String name,
                                      @RequestParam(value = "bankcardno") String bankcardno,
                                      @RequestParam(value = "mobile") String mobile,
                                      @RequestParam(value = "idcardno") String idcardno,
                                      @RequestParam(value = "expirydate") String expirydate,
                                      @RequestParam(value = "cvv2") String cvv2,
                                      @RequestParam(value = "authcode") String authcode,
                                      @RequestParam(value = "openid") String openid,
                                      @RequestParam(value = "buyerid") String buyerid,
                                      @RequestParam(value = "userip") String userip,
                                      @RequestParam(value = "extparams") String extparams);

    @RequestMapping(value = "/payorder/quick/confirm")
    Result<PayResult> quickPaySmsConfirm(@RequestParam(value = "tradenum") String tradenum,
                                         @RequestParam(value = "idcode") String idcode);


    @RequestMapping(value = "/payorder/quick/resend")
    Result<PayResult> quickPayResendSms(@RequestParam(value = "tradenum") String tradenum);


    @RequestMapping(value = "/payorder/refund")
    ResultJson paymentRefund(@RequestParam(value = "tradenum") String tradenum);


    @RequestMapping(value = "/payorder/assure/confirm")
    ResultJson paymentAssureConfirm(@RequestParam(value = "tradenum") String tradenum);


}
